import unittest
import time
import config


from lib.HTMLTestRunnerCN import HTMLTestReportCN
from scripts.test01_login import TestLogin
from scripts.test02_xhx_login import XhxLogin
from scripts.test03_getbattlelist import GetBattleList
from scripts.test04_getbattle_detail import GetBattleDetail
from scripts.test05_importorder import TestImportOrder
from scripts.test06_createOrUpdateSignExam import TestCreateOrUpdateSignExam
from scripts.test07_getExamExplain import TestExplain


suite = unittest.TestSuite()

suite.addTest(unittest.makeSuite((XhxLogin)))
suite.addTest(unittest.makeSuite(GetBattleDetail))
suite.addTest(unittest.makeSuite(GetBattleList))
suite.addTest(unittest.makeSuite(TestLogin))
suite.addTest(unittest.makeSuite(TestImportOrder))
suite.addTest(unittest.makeSuite(TestCreateOrUpdateSignExam))
suite.addTest(unittest.makeSuite(TestExplain))




# suite = unittest.TestLoader().discover(config.BASE_DIR+"/scripts","test*")

# report = config.BASE_DIR+"/report/report-{}.html".format(time.strftime("%Y%m%d-%H%M%S"))
report = config.BASE_DIR+"/report/report.html"

with open(report,"wb") as f:
    runner = HTMLTestReportCN(f,1,"测试报告","登录测试","虞俊")
    runner.run(suite)
